package Collection1;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Collection1 {
    public static void main(String[] args) {
        System.out.println("List类型");
        List<String> list=new ArrayList<>();
        list.add("Apple");
        list.add("Cherry");
        list.add("Apple2");
        list.add("Banana");
        list.remove("Banana");
        System.out.println(list.contains("Banana"));
        System.out.println(list);
        System.out.println("Set类型");
        Set<String> set=new HashSet<>();
        set.add("Apple");
        set.add("Cherry");
        set.add("Apple2");
        set.add("Banana");
        set.remove("Banana");
        System.out.println(set.contains("Banana"));
        System.out.println(set);
    }
}
